package com.enhe.gck.fg;

import com.enhe.gck.communal.PublicMethod;
import com.enhe.gck.communal.PublicReturn;
import com.enhe.gck.item.DepartmentHWANE17432Item;
import com.enhe.gck.pojo.Department;
import com.enhe.gck.pojo.OfficeVehicles;
import com.kuangkie.carbon.panel.CarbonPanel;
import com.kuangkie.carbon.record.FGRecord;
import org.springframework.stereotype.Repository;
import com.kuangkie.carbon.fg.FuncGroupContext;
import com.kuangkie.carbon.fg.ImproveResultFactory;
import com.kuangkie.carbon.fg.SecondRoundImproveFuncGroup;
import com.kuangkie.carbon.record.FGRecordComplexus;
import com.kuangkie.carbon.record.ProRecord;
import com.enhe.gck.CarbonBaseConstant; //模型Code
import com.enhe.gck.CarbonEnumKeyValue; //枚举字典信息
import com.enhe.gck.CarbonRelationType; //关系类型Code
import com.enhe.gck.item.OfficeVehiclesHWANE17382Item; // 模型属性Code

@Repository(value = "hwane17382366042330866425862")
public class OfficeVehiclesHWANE17382BNB implements SecondRoundImproveFuncGroup{
	
	@Override
	public void secondImprove(FuncGroupContext context, ProRecord proRecord, FGRecordComplexus recordComplexus,
			ImproveResultFactory improveResultFactory) {
		OfficeVehicles officeVehicles=proRecord.getBean(OfficeVehicles.class);
		Department department=CarbonPanel.getRecordQueryFactory(CarbonBaseConstant.部门信息_bmxx).getProConJunctionFactory()
				.addEqual(DepartmentHWANE17432Item.基本属性组_部门,officeVehicles.getDepartment())
				.goBack().queryABean(Department.class);
		if(department!=null){
			improveResultFactory.getCurrentProRecordOpsBuilder().putAttribute(OfficeVehiclesHWANE17382Item.基本属性组_部门NS主键,department.getNsId());
		}else {
			PublicMethod.returnMessage(improveResultFactory, PublicReturn.OfficeVehicles_1);
		}
	}
}
